﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace H2.NET.Web.Pages.SMD
{
    public partial class uc_search_bmc : System.Web.UI.UserControl
    {
        /// <summary>
        /// 需要赋值的控件[控件Id, 字段]
        /// </summary>
        public Dictionary<string, string> bmcDic { get; set; }

        /// <summary>
        /// 回掉函数
        /// </summary>
        public string bmcCallBack { get; set; }

        /// <summary>
        /// 前台页面js方法
        /// </summary>
        public string str_js;

        protected void Page_Load(object sender, EventArgs e)
        {
            if (bmcDic != null)
            {
                foreach (KeyValuePair<string, string> pair in bmcDic)
                {
                    
                    if (pair.Key.Trim().ToLower() == "bmccode")
                    {
                        str_js += "$(\"#" + pair.Key + "\").val($(this).find(\"td[name='" + pair.Value + "']\").text());";
                    }
                    else if (pair.Key.Trim().ToLower() == "l_bmcname")
                    {
                        str_js += "$(\"#" + pair.Key + "\").text($(this).find(\"td[name='" + pair.Value + "']\").text());";
                    }                    
                }
                
            }
        }
    }
}